
from django.db.models import CharField, DateTimeField
from apps.vadmin.op_drf.models import CoreModel

# 供应商表
class Suppliers(CoreModel):
    name = CharField(max_length=250,null=False,unique=True,verbose_name="供应商名称")
    address = CharField(max_length=256,null=True,verbose_name="地址1")
    address2 = CharField(max_length=256,null=True,verbose_name="地址2")
    city = CharField(max_length=128,null=True,verbose_name="城市")
    state = CharField(max_length=128,null=True,verbose_name="省份")
    country = CharField(max_length=128,null=True,verbose_name="国家")
    phone = CharField(max_length=20,null=True,verbose_name="手机号")
    fax = CharField(max_length=32,null=True,verbose_name="传真")
    email = CharField(max_length=128,null=True,verbose_name="邮箱")
    contact = CharField(max_length=128,null=True,verbose_name="联系人")
    notes = CharField(max_length=256,null=True,verbose_name="备注")
    deleted_datetime = DateTimeField(null=True,verbose_name="删除时间")
    zip = CharField(max_length=16,null=True,verbose_name="邮政编码")
    url = CharField(max_length=256,null=True,verbose_name="官网url")
    image = CharField(max_length=256,null=True,verbose_name="图片url")

    class Meta:
        verbose_name = '供应商'
        verbose_name_plural = verbose_name

    def __str__(self):
        return f"{self.name}"


